package com.yanxu.controller;

import com.yanxu.entity.User;
import com.yanxu.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author 折戟沉沙铁未销
 * @version V1.0
 * @date 2025-10-10-2025
 * @Description: user controller
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/getUserList")
    public List<User> getUserList() {
        return userService.getUserList();
    }

    @PostMapping("/saveUser")
    public void saveUser(@RequestBody User user){
        userService.saveUser(user);
    }
}